Propagate fatal error from Link query in FDS#722
Merged
stefanvanburen merged 1 commit intomainfrom Apr 29, 2026
Merged
Conversation
`FDS.Execute` was not checking `linkResult[0].Fatal` before iterating over IR files. When `Link.Execute` fails fatally (e.g. due to a file-open error like `DuplicateProtoPathError`), its result value is nil, so FDS silently produced an empty `FileDescriptorSet` with no fatal error instead of propagating the underlying error to callers. Add the same guard used elsewhere in this package — identical to the check in `IR.Execute` after its `AST` sub-query (`ir.go:62-64`), and to the `fdpResults` check already present later in `FDS.Execute` itself.
stefanvanburen
added a commit
to bufbuild/buf
that referenced
this pull request
Apr 28, 2026
When a proto file is contained in multiple modules (DuplicateProtoPathError), the new experimental compiler was silently swallowing the typed error: FDS did not check the fatal error from its Link sub-query, producing an empty FileDescriptorSet instead of propagating the error upward. This meant callers of compileImage could not inspect it via errors.As, and the downstream "nil FileDescriptor" panic was unhelpful. The fix is in protocompile (bufbuild/protocompile#722): FDS.Execute now checks linkResult[0].Fatal before iterating over IR files, propagating the Link fatal as its own. With this, results[0].Fatal in compileImage is DuplicateProtoPathError, which is returned directly so callers retain its type information and the existing "Failure: " / exit code 1 behavior is preserved.
doriable
approved these changes
Apr 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
FDS.Executewas not checkinglinkResult[0].Fatalbefore iterating over IR files. WhenLink.Executefails fatally (e.g. due to a file-open error likeDuplicateProtoPathError), its result value is nil, so FDS silently produced an emptyFileDescriptorSetwith no fatal error instead of propagating the underlying error to callers.Add the same guard used elsewhere in this package — identical to the check in
IR.Executeafter itsASTsub-query (ir.go:62-64), and to thefdpResultscheck already present later inFDS.Executeitself.